import { Component, OnInit } from '@angular/core';
import { CommonList } from '../common/model/commom.model';
import { ASYNC_URLS } from '../r-mobile-url';

@Component({
  selector: 'oy-requisition-list',
  templateUrl: './requisition-list.component.html',
  styleUrls: ['./requisition-list.component.scss']
})
/**
 * 描述：采购列表TS
 * 公司：xxx有限公司
 * 版权：xxx2020
 * 作者：oyjl
 * 时间：2020-04-27 14:07:23
 */
export class RequisitionListComponent implements OnInit {
  public commonList: CommonList;
  constructor() {
    this.commonList = new CommonList({
      head: '请购单列表',
      tabConfig: [
        {
          head: '待审核', isRequest: true, url: ASYNC_URLS.requisitionList,
          req: {
            oaRequisition: {},
            dingFlag: '1'
          },
          jumpUrl: '/mobile/requisitionDetail/audit',
          listConfig: {
            id: 'requisitionId',
            head: {
              text: '请购单号', orderNum: 'requestNo', status: 'tableStatusName'
            },
            fields: [
              { text: '项目名称', field: 'oaProject.projectName' },
              { text: '请购人', field: 'personName' },
              { text: '请购数量', field: 'requestCount' },
              { text: '期望到货时间', field: 'expectDate' }
            ]
          }
        },
        {
          head: '已审核', isRequest: true, url: ASYNC_URLS.requisitionList,
          req: {
            oaRequisition: {},
            dingFlag: '2'
          },
          jumpUrl: '/mobile/requisitionDetail/detail',
          listConfig: {
            id: 'requisitionId',
            head: { text: '请购单号', orderNum: 'requestNo', status: 'tableStatusName' },
            fields: [
              { text: '项目名称', field: 'oaProject.projectName' },
              { text: '请购人', field: 'personName' },
              { text: '请购数量', field: 'requestCount' },
              { text: '期望到货时间', field: 'expectDate', dictKey: 'date', dict: 'yyyy-MM-dd' }
            ]
          }
        }
      ]
    });
  }

  ngOnInit() {
  }

}
